#ifndef WWMAINTABDIALOG_H
#define WWMAINTABDIALOG_H

#include <QDialog>
#include <boost/shared_ptr.hpp>


namespace Ui {
    class WWMainTabDialog;
}

class TribeMgrDlg;
class QTIMReceiverDlg;
class IMLoginDlg;
class FileTransferMgrDlg;
class FileTransferScrollDialog;
class IMHistoryMgrDlg;

class WWMainTabDialog : public QDialog
{
    Q_OBJECT

public:
    explicit WWMainTabDialog(QWidget *parent = 0);
    ~WWMainTabDialog();

public:
    void SetWWMainUniqueFlag(const std::string& unique);
    void InitMsgHandler();

public slots:
    void OnReceiveLogout();
    void OnActiveWorkSpace(QString);
    void OnActiveWorkSpace();
    void OnActiveTribe();
    void OnActiveFileTransfer();
    void OnChangedTab(int);
    void InitTabs();
    void OnOpenHistory();
    void OnIMMainError();
    void OnOpenTribeHistory();
    void OnLoginOK(std::string);

signals:
    void initBegin();

protected:
    virtual void closeEvent(QCloseEvent *e);
private:
    Ui::WWMainTabDialog *ui;
    bool m_im_newactivity;
    std::string m_oldloginuid;
    bool m_closeby_hand;
    bool m_tribe_newactivity;
    bool m_filetransfer_newactivity;

public:
    boost::shared_ptr<QTIMReceiverDlg> m_im_mgr;
    boost::shared_ptr<TribeMgrDlg> m_tribe_mgr;
    boost::shared_ptr<IMLoginDlg>  m_logindlg;
    boost::shared_ptr<FileTransferScrollDialog>  m_transfer_mgr;
    boost::shared_ptr<IMHistoryMgrDlg>  m_history_mgr;

};

#endif // WWMAINTABDIALOG_H
